<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Books561</title>
        <link rel="stylesheet" href="./assets/style.css">
    </head>
    <body>
        <%@include file="header.jsp" %>

        <c:import var="xml" url="WEB-INF/BooksFile.xml"/>
        <c:set var="isbn" value="${param.isbn}"/>
        <x:parse var="doc" doc ="${xml}"/>
        <x:forEach var="root"
                   select='$doc/*[local-name()="Books" and namespace-uri()="http://www.bookstore.net/schema/order"]'>
            <x:forEach var="node"
                       select='$root//*[local-name()="Isbn" and namespace-uri()="http://www.bookstore.net/schema/order"]'>
                <x:set var="book" select="$node/.."/>
                <x:if select="$node = $isbn">
                    <div class="container">
                        <h2>Book Detail</h2>
                        <div class="bookDetail">
                            <div>
                                <img class="coverUrl" src="<x:out select='$book/*[local-name()="Url" and namespace-uri()="http://www.bookstore.net/schema/order"]'/>" alt="">
                                <div class="desc">
                                    <div class="title"> <x:out select='$book/*[local-name()="Title" and namespace-uri()="http://www.bookstore.net/schema/order"]'/></div>
                                    <div class="author"> <x:out select='$book/*[local-name()="Author" and namespace-uri()="http://www.bookstore.net/schema/order"]'/></div>
                                    <div class="publisher"> <x:out select='$book/*[local-name()="Publisher" and namespace-uri()="http://www.bookstore.net/schema/order"]'/></div>
                                    <button class="btnAddCart" onclick="addToCart(this)" data-isbn="<x:out select='$book/*[local-name()="Isbn" and namespace-uri()="http://www.bookstore.net/schema/order"]'/>" data-title="<x:out select='$book/*[local-name()="Title" and namespace-uri()="http://www.bookstore.net/schema/order"]'/>" data-author="<x:out select='$book/*[local-name()="Author" and namespace-uri()="http://www.bookstore.net/schema/order"]'/>" data-cover="<x:out select='$book/*[local-name()="Url" and namespace-uri()="http://www.bookstore.net/schema/order"]'/>" data-price="<x:out select='$book/*[local-name()="Price" and namespace-uri()="http://www.bookstore.net/schema/order"]'/>"><span class="price">$<x:out select='$book/*[local-name()="Price" and namespace-uri()="http://www.bookstore.net/schema/order"]'/></span>Add to Cart</button>
                                    <p> <x:out select='$book/*[local-name()="Desc" and namespace-uri()="http://www.bookstore.net/schema/order"]'/></p>
                                </div>
                            </div>
                        </div>
                    </div>
                </x:if>
            </x:forEach>
        </x:forEach>
        <%@include file="footer.jsp" %>
    </body>
</html>
